package com.drug.mingkang.service;

import com.drug.mingkang.model.HqInventory;
import com.drug.mingkang.model.vo.DrugInventoryDetailVo;
import com.drug.mingkang.model.vo.InventoryVo;
import com.drug.mingkang.model.vo.MaterialInventoryDetailVo;
import com.drug.mingkang.model.vo.MaterialInventoryVo;
import com.drug.mingkang.model.vo.*;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

/**
 * 总公司库存表(HqInventory)表服务接口
 *
 * @author wenchangjian
 * @since 2020-08-11 12:00:13
 */
public interface HqInventoryService {

    /**
     * 通过ID查询单条数据
     *
     * @param inventoryId 主键
     * @return 实例对象
     */
    HqInventory queryById(String inventoryId);

    HqInventory queryByDrugId(String drugId);

    int updateByDrug (List<HqInventory> list);

    /**
     * 根据材料id查找材料库存
     * @param materialId
     * @return
     */
    HqInventory queryByMaterialId(String materialId);



    /**
     * 新增数据
     *
     * @param hqInventory 实例对象
     * @return 实例对象
     */
    HqInventory insert(HqInventory hqInventory);

    /**
     * 查询全部
     * @return
     */
    List<HqInventory> queryAll();

    /**
     * 修改数据
     *
     * @param hqInventory 实例对象
     * @return 实例对象
     */
    HqInventory update(HqInventory hqInventory);

    /**
     * 通过主键删除数据
     *
     * @param inventoryId 主键
     * @return 是否成功
     */
    boolean deleteById(String inventoryId);

    HqInventory selectMaterialId(String materialId);

    /**
     * 批量修改
     * @param list
     * @return
     */
    int updateBatch(List<HqInventory> list);

    HqInventory selectDrugId(String drugId);

    /**
     * 质检入库
     * @param list
     * @return
     */
    int quality(List<HqInventory> list);

    List<MaterialInventoryVo> selectMaterialAll(MaterialInventoryVo vo);

    int selectMaterialCount(MaterialInventoryVo vo);


    List<MaterialInventoryDetailVo> findMaterialsDetails(MaterialInventoryDetailVo vo);

    int findMaterialsDetailsCount(MaterialInventoryDetailVo vo);

    /**
     * 查询总公司公司药品库存
     * @param inventoryVo  库存Vo
     * @return
     */
    Map<String, Object> showDrugInventoryAll(InventoryVo inventoryVo);

    /**
     * 根据药品id查看出入库明细
     * @param id  库存id
     * @param page   页
     * @param limit   条
     * @return
     */
    Map<String,Object> findByRepertoryId(String id, int page, int limit);

    List<DrugInventoryDetailVo> findDrugDetails(DrugInventoryDetailVo vo,String id);

    int findDrugDetailsCount(DrugInventoryDetailVo vo,String id);

    /**
     * 查询总公司 药品库存预警
     * @param zgsYpkcyj
     * @param companyId
     * @param page
     * @param limit
     * @return
     */
    Map<String, Object> findAllDrugEarlyWarning(int zgsYpkcyj, String companyId,int page , int limit);

    List<PurchaseMaterialVo> findMaterialsWarning(PurchaseMaterialVo vo,int num);

    int findMaterialsWarningCount(PurchaseMaterialVo vo,int num);

    int findCount(HttpSession session);
}